<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Basic Struts 2 Application - Welcome</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>
$(document).ready( function() {
	$("#import_button").click(function(){
		var emails = {"emails":"acvolcano@gmail.com,acvolcano@hotmail.com"};
		$.ajax(
						{
							url:"importEmails.action", 
	    					data:emails,
			    			success:function(data, status){
			    				alert("Data: " + data.toString() + "\nStatus: " + status);
			    			},
			    			
			    			type:"post",
			    			dataType:"json"
			    		}
	    );
	 });
});	
</script>

</head>
<body>
<h1>Welcome To Struts 2!</h1>


<div id="import">	
									<table>
										<tbody>
											<tr>
												<td width="50%">
													<div class="result_header">Source:</div>
													<button id="import_button" type="button">import &rsaquo;&rsaquo;</button>
												</td>
												<td>
													<div class="result_body_header">Result:</div>
												</td>
											</tr>
											<tr>
												<td>
													<textarea id="login_original" name="original"></textarea>
												</td>
												<td>
													<div id="result_body"></div>
												</td>
											</tr>
										</tbody>
									</table>
							<div id="import_log">log:</div>
						</div>
</body>
</html>